import 'package:bloc/bloc.dart';
import 'package:qgchat/http/apis/live.dart';
import 'package:qgchat/http/models/LiveListModel.dart';

class LiveRoomInfoBlocEvent {}

class LiveRoomInfoBlocBloc extends Bloc<LiveRoomInfoBlocEvent, LiveListModel> {
  final int id;

  LiveRoomInfoBlocBloc(this.id) {
    add(LiveRoomInfoBlocEvent());
  }

  @override
  Stream<LiveListModel> mapEventToState(LiveRoomInfoBlocEvent event) async* {
    yield await LiveApis.liveInfo(id).then((value) => value);
  }

  @override
  get initialState => LiveListModel();
}
